package com.libinyn.base.pms.entity;

import com.libinyn.base.pms.entity.sys.SysUserEntity;
import org.apache.shiro.SecurityUtils;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * @fileName: BaseModel.java
 * @author: bin.li01
 * @date: 2017/12/3 16:14
 * @version: v1.0.0
 */
public class BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 逻辑删除 ，1 表示删除，0 表示未删除。
     */
    protected Integer isDeleted;

    /**
     * 创建人ID
     */
    protected Long  createBy;

    /**
     * 创建时间
     */
    protected Date createTime;

    /**
     * 修改人ID
     */
    protected Long  updateBy;

    /**
     * 修改时间
     */
    protected Date updateTime;


    @Transient
    protected SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();

    public SysUserEntity getCurrentUser() {
        return currentUser;
    }

    public void setCurrentUser(SysUserEntity currentUser) {
        this.currentUser = currentUser;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
}
